<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        ul,
        ol,
        li {
            list-style: none;
        }
        
        #box {
            width: 600px;
            height: 600px;
            margin: 100px auto;
        }
        
        #box .boxTop {
            overflow: hidden;
        }
        
        #box .boxTop>li {
            float: left;
            width: 200px;
            height: 100px;
            background: tan;
            font: 20px/100px "";
            text-align: center;
        }
        
        #box .boxBottom {
            position: relative;
        }
        
        #box .boxBottom>li {
            width: 600px;
            height: 500px;
            background: hotpink;
            position: absolute;
            top: 0;
            left: 0;
            font: 100px/500px "";
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="box">
        <ul class="boxTop">
            <li>1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <ol class="boxBottom">
            <li>1</li>
            <li>2</li>
            <li>3</li>
        </ol>
    </div>
</body>

</html>
<SCript>
    var boxTop = document.querySelector('.boxTop')
    var boxBottom = document.querySelector('.boxBottom')
    var uArr = boxTop.children;
    console.log(uArr);
    var oArr = boxBottom.children;
    for (let i = 0; i < uArr.length; i++) {
        console.log(i);
        // uArr[i].index = i;
        // uArr[i].onclick = function() {
        //     for (var j = 0; j < uArr.length; j++) {
        //         uArr[j].style.background = ''
        //         oArr[j].style.zIndex = ''
        //     }
        //     this.style.background = 'hotpink'
        //     oArr[this.index].style.zIndex = '99'
        // }
        uArr[i].onclick = function() {
            for (var j = 0; j < uArr.length; j++) {
                uArr[j].style.background = ''
                oArr[j].style.zIndex = ''
            }
            this.style.background = 'hotpink'
            oArr[i].style.zIndex = '99'
        }
    }
</SCript>